package net.bwie.realtime.jtp.dws.log2.function2;

import net.bwie.realtime.jtp.dws.log2.bean2.PageViewBean2;
import org.apache.flink.api.common.functions.ReduceFunction;

public class PageViewReportReduceFunction2 implements ReduceFunction<PageViewBean2> {
    @Override
    public PageViewBean2 reduce(PageViewBean2 tmp, PageViewBean2 bean2) throws Exception {
        //1.增量计算：各个指标值相加
        tmp.setPvCount(tmp.getPvCount()+bean2.getPvCount());
        tmp.setPvDuringTime(tmp.getPvDuringTime()+bean2.getPvDuringTime());
        tmp.setUvCount(tmp.getUvCount()+bean2.getUvCount());
        tmp.setSessionCount(tmp.getSessionCount()+bean2.getSessionCount());
        return tmp;
    }
}
